package com.zhangck.bos2_0.Service.transit.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;

import com.zhangck.bos2_0.Service.transit.DeliveryInfoService;
import com.zhangck.bos2_0.dao.Transit.DeliveryInfoRepository;
import com.zhangck.bos2_0.dao.Transit.TransitInfoRepository;

import cn.itcast.bos.domain.transit.DeliveryInfo;
import cn.itcast.bos.domain.transit.TransitInfo;

/** 
* @author 上午茶
* @version 创建时间：2018年6月20日 上午9:13:08 
* 类说明 
*/
@Service
@Transactional
public class deliveryInfoServiceImpl implements DeliveryInfoService {

	@Autowired
	private DeliveryInfoRepository deliveryInfoRepository;
	
	@Autowired
	private TransitInfoRepository transitInfoRepository;
	
	@Override
	public void save(String deliveryId, DeliveryInfo model) {
		deliveryInfoRepository.save(model);
		
		TransitInfo transitInfo = transitInfoRepository.findOne(Integer.parseInt(deliveryId));
	
		transitInfo.setDeliveryInfo(model);
		
		transitInfo.setStatus("开始配送");
	}

}
